Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extend-object

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extend-object

Underscore's extend method as a standalone Common JS module.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
251K
decreased by-13.07%
Maintainers
1
Weekly downloads
 
Created
Source

extend-object

underscore's extend method adapted and extracted as a standalone CommonJS module.

Note this does not shim Array.prototype.forEach so if you're in <IE8 you'll need to polyfill it. But basically any other browser will work.

usage

var extend = require('extend-object');

var obj = {hi: 'there'};

extend(obj, {hello: 'you'});

console.log(obj); // {hi: 'there', hello: 'you'}

// it extends the first object in place
console.log(obj === extend(obj, {})); // 'true'

// you can pass as many objects as you want
extend(obj, {something: 'else'}, {other: 'item'});

// if there are conflicting keys the last one wins
extend(obj, {something: 'ok'}, {something: 'newer'});
console.log(obj.something); // 'newer'

install

npm install extend-object

credits

All credit goes to Jeremy Ashkenas and the other underscore.js authors.

license

MIT as per underscore.

Keywords

FAQs

Package last updated on 10 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc